#include <stdio.h>
#include <malloc.h>
#define max_size 10


typedef struct my_queue 
{
    int array[max_size];
    int front;
    int rear;
}my_queue;

void queue_init(my_queue* queue)
{
    if(!queue)
    {
        return;
    }
    queue->front = -1;
    queue->rear = -1;
}

void queue_destroy(my_queue* queue)
{
    if(queue == NULL)
    {
        return;
    }
    free(queue);
}

bool empty(my_queue* queue)
{
    if(queue->rear == -1)
    {
        printf("为空");
        return true;
    }
    printf("非空");
    return false;
}

void push(my_queue* queue, int ele)
{
    if(queue->front != queue->rear && queue->rear % (max_size - 1) == queue->front)
    {
        return;
    }
    if(queue->front == -1)
    {
        queue->front = 0;
    }
    queue->array[++(queue->rear)] = ele;
}

void pop(my_queue* queue)
{
    if(queue->rear == -1)
    {
        return;
    }
    if(queue->front == 0)
    {
        queue->front--;
    }
    queue->rear--;
}

int main()
{
    my_queue* queue;
    queue_init(queue);
    push(queue, 1);
    pop(queue);
    push(queue, 1);
    empty(queue);
    return 0;
}